<?php

namespace app\middleware;

class ReturnHomePage
{
    public function handle($request, \Closure $next)
    {
        return boolval(cache('?admin_user_info')) == true ?
            redirect('/home') : $next($request);
    }
}